﻿using FunArts.EasyDevOps.Shared.Models.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FunArts.EasyDevOps.Shared.Models.SshClient.Command
{
    /// <summary>
    /// Nginx安装命令
    /// </summary>
    public class PackageInstallCommand : ILinuxCommand
    {
        public string PackagePath { get; set; }
        public string BuildCommand(SystemVersionTypeEnum systemVersionType)
        {
            switch (systemVersionType)
            {
                case SystemVersionTypeEnum.Ubuntu:
                    return $"sudo dpkg -i {PackagePath}/*.deb";
                case SystemVersionTypeEnum.CentOS:
                    return $"sudo rpm -ivh {PackagePath}/*.rpm";
                case SystemVersionTypeEnum.Windows:
                    break;
                default:
                    break;
            }
            return string.Empty;
        }
    }
}
